#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class OutputPin;
class Trigger;

/// <summary>
/// AcceptEventAction
/// An AcceptEventAction is an Action that waits for the occurrence of one or more
/// specific Events.
/// </summary>
class UMLMODEL_EXPORT AcceptEventAction : public Action {

public: // Constructors and destructors
    explicit AcceptEventAction(const QString& umlType="uml::AcceptEventAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// isUnmarshall getter
    /// Indicates whether there is a single OutputPin for a SignalEvent occurrence, or
    /// multiple OutputPins for attribute values of the instance of the Signal
    /// associated with a SignalEvent occurrence.
    /// </summary>
    bool isUnmarshall() const;

    /// <summary>
    /// isUnmarshall setter
    /// Indicates whether there is a single OutputPin for a SignalEvent occurrence, or
    /// multiple OutputPins for attribute values of the instance of the Signal
    /// associated with a SignalEvent occurrence.
    /// </summary>
    void setIsUnmarshall(bool value);

    /// <summary>
    /// results getter
    /// OutputPins holding the values received from an Event occurrence.
    /// </summary>
    vector<shared_ptr<OutputPin>>& results();

    /// <summary>
    /// triggers getter
    /// The Triggers specifying the Events of which the AcceptEventAction waits for
    /// occurrences.
    /// </summary>
    vector<shared_ptr<Trigger>>& triggers();

private: // Fields
    /// <summary>
    /// isUnmarshall
    /// Indicates whether there is a single OutputPin for a SignalEvent occurrence, or
    /// multiple OutputPins for attribute values of the instance of the Signal
    /// associated with a SignalEvent occurrence.
    /// </summary>
    const static bool isUnmarshall_default_;
    bool isUnmarshall_= isUnmarshall_default_;

    /// <summary>
    /// results
    /// OutputPins holding the values received from an Event occurrence.
    /// </summary>
    vector<shared_ptr<OutputPin>> results_;

    /// <summary>
    /// triggers
    /// The Triggers specifying the Events of which the AcceptEventAction waits for
    /// occurrences.
    /// </summary>
    vector<shared_ptr<Trigger>> triggers_;

};

} // namespace uml
